﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace POB.Gameplay.Components
{
    class DrawS : Component
    {
        Vector2 pos;
        Texture2D tex;

        public DrawS(XElement unitElement, World world, Player player, Unit unit)
            :base(unitElement, world, player, unit)
        {
            pos = unitElement.Attribute("Position").Value.ToVector2();
            tex = world.Content.Load<Texture2D>(unitElement.Value);
        }
        
        public override void Update(float time)
        {
            base.Update(time);
        }

        public override void Draw(float time, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Matrix matrix)
        {
            spriteBatch.Begin(matrix);

            spriteBatch.Draw(tex, pos, Color.White);

            spriteBatch.End();
            base.Draw(time, spriteBatch, matrix);
        }
    }
}
